#pragma once
#include <QMainWindow>
#include <QAction>
#include <QComboBox>
#include <QLineEdit>
#include "../gui/BarWidget.h"
#include "../thread/SortThread.h"

class MainWindow : public QMainWindow {
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);

    ~MainWindow();

private slots:
    void playPause();

    void speedChanged(int);

    void algoChanged(int);

    void shuffleChanged(int);

    void sizeEdited();

    void updateFrame(const QVector<uint32_t>& data,
                 const QVector<int>&      tag,
                 SortStats                st);

private:
    BarWidget *m_view = nullptr;
    SortThread *m_thread = nullptr;

    QAction *m_play;
    QComboBox *m_speedBox, *m_shuffleBox, *m_algoBox;
    QLineEdit *m_sizeEdit;

    SortConfig m_cfg;
};
